1. The Field of the Invention
The present invention generally relates to grid or table controls. More particularly, the present invention provides methods and apparatus for reducing memory requirements for a grid or table control by sharing a single row characteristic object between multiple row objects.
2. Background and Relevant Art
Databases are widely known and commonly used to collect data in an organized fashion so that its contents can be easily accessed, managed and updated. Databases contain aggregations of data records or files, such as sales transactions, product catalogs and inventories, and customer profiles. Databases are prevalent in large mainframes, smaller distributed work stations, mid-range systems, personal computers, etc.
A typical database includes a set of tables containing data for pre-defined categories. Each table may contain one or more data rows and columns. Rows contain unique instances or records of the data for categories defined by the columns. For example, a business order entry database might include a database table that describes a customer with columns for name, account number, address, phone number and so forth. Another database table might describe an order with columns for product, customer, date, sales price, and so forth. Each single piece of data (such as the account number) is a data field or cell in the database table.
Data grid or table controls are commonly used to display the data fields from the database table in a grid-like fashion. The grid controls display the database fields or cells in an organized fashion, and allow the user to interact and view those portions of the database. For example, FIG. 1 illustrates a basic Grid Control 110 used to display data from a large Database Table 100, which has one million rows. As shown in FIG. 1, Grid Control 110 displays Columns 120 and Rows 125 which make up a grid of individual Cells 130 that contain data from Database Table 100.
One common performance concern for grid or table controls is memory consumption. When a grid control is dealing with a database having a large number of rows, such as Database Table 100 which has a million rows, the corresponding memory allocations often result in memory-swapping between the random access memory (RAM) and the hard drive. Accordingly simple interaction with the user, such as scrolling from row to row or from page to page, can become slow and tedious for the grid or table control.
Because of the above performance degradation for common grid controls, there currently exists various attempts to increase grid control performance. For example, one technique attempts to anticipate what rows will be viewed next and only allocate memory for those rows. One example of this technique, allocates memory not only for the rows displayed but also for an amount (e.g., full screen) of rows just above and below the currently displayed set of rows. FIG. 1 illustrates an example of this technique, wherein Grid Control 110 allocates memory for those rows just above 105 and just below 115 Grid Control 110. These areas of memory allocation 105 and 115 are commonly referred to as an extended window, and although they may slightly improve the overall scrolling capabilities of the grid control there is no mechanism that effectively allows a user to instantaneously access a row outside the visible or extended window. For example, if a user is presently looking at row 501,000 and wishes to access row 970,322 (shown as row object 135), because this row is not in memory the grid control must go to the backend database and retrieve all characteristic and data for the particular row object 135. (Memory requirements generally prohibit a grid control from keeping an entire database of this size in memory at one time.)
Accordingly, there exists a need for a grid or table control that can enhance the user interaction experience by allowing instant access to any row within the database table, while reducing memory requirements.